import { ZYSDK } from "../../../ZYSDK";
import { soundMgr } from "../def/sound";
import { UIMgr } from "../manager/viewMgr";
import AbstractBean from "./AbstractBean";

/**
 * 
 * @author: xj.huang
 * @date: 2021/07/31 18:45:06
 */
export default class InitGameBean extends AbstractBean {
    
    constructor() {
        super("InitGameBean")
    }
    async start(){
        soundMgr.playBgm()
        await UIMgr.asyncOpen(ViewRes.VIEW_GAMESTART);
        await UIMgr.asyncOpen(ViewRes.VIEW_BANNER) as ZYSDK.BannerView;
        let gameView= await UIMgr.asyncOpen(ZYSDK.config.gameSceneUrl) as Laya.View;
        gameView.zOrder = -1
        await UIMgr.asyncExportOpen(ZYSDK.gameConfig.box_conf.home)
        this.finish()
    }
}